﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;

namespace ShakeIt_Server
{
    // 注意: 使用“重构”菜单上的“重命名”命令，可以同时更改代码和配置文件中的接口名“IService1”。
    [ServiceContract]
    public interface IService1
    {
        [OperationContract]
        int Login(string username, string password);

        //operation of User
        [OperationContract]
        List<_User> FindUser(int userid);
        [OperationContract]
        List<User> FindUserByName(string username);
        [OperationContract]
        string InsertUser(string username,string password, string cellPhone);
        [OperationContract]
        string UpdatePassword(string username, string old_password, string new_password);
        [OperationContract]
        string UpdateCellPhone(string username, string cellPhone);
        
        //operation of Activity
        [OperationContract]
        List<_Activity> FindActivityById(int id);
        [OperationContract]
        List<_Activity> FindActivityByLocation(decimal currentLongitude, decimal currentLatitude);
        [OperationContract]
        List<_Activity> FindActivityByLocationAndKeyword(decimal currentLongitude, decimal currentLatitude, string keyword);
        /********************
         * 根据各种查询条件加入查询方法FindXXX
         *
         *
         *
         *
         */
        [OperationContract]
        string InsertActivity(int userid, string type, string title, string detail, decimal longitude, decimal latitude, string address, DateTime beginTime, DateTime endTime);
        [OperationContract]
        //在具体使用时，可以用null填补无需修改的数据
        string UpdateActivity(int id, string type, string title, string detail, decimal longitude, decimal latitude, string address, DateTime beginTime, DateTime endTime);
        //[OperationContract]
        //List<timeOfActivity> getCurrentValidActivity(); //获取当天正在进行的活动

        //operation of UserComment
        [OperationContract]
        List<_UserComment> GetAllComment(int userId);
        [OperationContract]
        string InsertComment(int userId, int commenterId, int score, string commentContent);
        //[OperationContract]
        //List<_UserComment> GetRecentComment(int userId);
        //[OperationContract]
        //double GetScore(int userId);

        //operation of Focus
        [OperationContract]
        string SetFocus(int id1, int id2); //id1 <---focus--- id2
        [OperationContract]
        string RemoveFocus(int id1, int id2); //id1 <---focus--- id2
        [OperationContract]
        List<_User> GetFans(int id);
        [OperationContract]
        List<_User> GetFocus(int id);
        [OperationContract]
        bool IsFocus(int id1, int id2); //id1 <---focus--- id2
        
        //operation of Chat
        [OperationContract]
        List<_Chat> FindChatBySendId(int sendId);
        [OperationContract]
        List<_Chat> FindChatByReceiveId(int receiveId);
        [OperationContract]
        List<_Chat> FindAllChatBetweenTwo(int id1, int id2);
        [OperationContract]
        string InsertChat(string content, int sendId, int receiveId);
        
    }
}
